package com.qezhhnjy.druid;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.jdbc.core.JdbcTemplate;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author zhaoyangfu - 2021/3/16 11:11
 */
@SpringBootApplication
@Slf4j
public class DruidApp implements CommandLineRunner {

    @Resource
    private JdbcTemplate jdbcTemplate;

    public static void main(String[] args) {
        SpringApplication.run(DruidApp.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        List<Map<String, Object>> maps = jdbcTemplate.queryForList("show databases");
        log.info("maps=>{}", maps);
    }
}
